<template>
<transition name="el-fade-in-linear">
    <div class="paymentPopUp" v-show="isShow">
        <div class="mainBox">
            <img @click="closeBtn" class="closeBtn" src="../assets/img/closeBtn.png" alt="">
            <div class="infoBox">
                <div class="name FONT">
                    <img src="../assets/img/ju.png" alt="">
                    <span>{{goods.name}}</span>
                </div>
                <div class="price FONT">￥{{goods.sellingPrice}}</div>
            </div>
            <div class="codeBox">
                <div class="code">
                    <img v-if="qrCode" :src="qrCode" alt="">
                    <myLoading v-if="!qrCode"></myLoading>
                </div>
            </div>
            <div class="tips FONT">请打开微信扫码进行支付</div>
        </div>
    </div>
</transition>
</template>

<script>
import myLoading from './myLoading'
export default {
    
    components:{
        myLoading
    },
    props:{
        // 是否展示
        isShow:false,
        // 商品信息
        goodInfo:{},
        // 支付二维码
        qrCode:'',
    },
    computed:{
        goods(){
            return this.goodInfo;
        }
    },
    methods:{
        // 点击关闭弹框
        closeBtn(){
            this.$emit('update:isShow',false)
            this.$emit('paymentSuccess')
        },
    }
}
</script>

<style lang="less" scoped>
.paymentPopUp{
    width: 100%;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.5);
    position: fixed;
    top: 0;
    left: 0;
    z-index: 999;
    .mainBox{
        width: 760px;
        height: 960px;
        margin: 0 auto;
        margin-top: 396px;
        border: 4px solid;
        border-image: linear-gradient(129.5deg, #7875FC, #F899D5, #FBB1B7) 30 30;
        background: linear-gradient(159.64deg, #C9C8FE 0.16%, #FFFFFF 154.29%);
        box-shadow: 8px 10px 10px 0px #03009233;
        position: relative;
        padding-top: 140px;
        box-sizing: border-box;
        padding-right: 20px;
        .closeBtn{
            width: 72px;
            height: 72px;
            position: absolute;
            right: -36px;
            top: -36px;
        }
        .infoBox{
            width: 100%;
            height: auto;
            text-align: center;
            font-weight: 500;
            .name{
                font-size: 48px;
                color: #7875FC;
                display: flex;
                align-items: center;
                position: relative;
                justify-content: center;
                img{
                    width: 14px;
                    height: 14px;
                    margin-right: 19px;
                }
            }
            .price{
                font-size: 48px;
                color: #7875FC;
            }
        }
        .codeBox{
            width: 400px;
            height: 400px;
            background-image: url('../assets/img/Rectangle 30399.png');
            background-size: 100% 400px;
            // border: 5px solid;
            // border-image: linear-gradient(180deg, #7875FC, #FD9AAF, #FFCA99) 30 30;
            // clip-path: inset(0 round 10px);
            margin: 0 auto;
            margin-top: 28px;
            display: flex;
            align-items: center;
            justify-content: center;
            padding: 10px;
            box-sizing: border-box;
            
            .code{
                width: 100%;
                height: 100%;
                background-color: #fff;
                border-radius: 12px;
                overflow: hidden;
                position: relative;
                img{
                    width: 100%;
                    height: 100%;
                }
            }
        }
        .tips{
            width: 100%;
            font-size: 32px;
            color: #7875FC;
            text-align: center;
            margin-top: 26px;
        }
    }
}
</style>